package bv.nnn;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.client.RestTemplate;

/**
 * Hello world!
 *
 */
@SpringBootApplication
@Controller
public class App 
{
 @RequestMapping("test")
 @ResponseBody
 public String test() {
	 
	 return "test";
 }
    @RequestMapping("test1")
	@ResponseBody
	public String test1() {
		RestTemplate restTemplate = new RestTemplate();
		
		String result = restTemplate.getForObject("https://www.baidu.com",String.class);
		return result;
    }
    @RequestMapping(value="test2")
	public String test2(Model model) {
		String xx = "调试";
		model.addAttribute("name", xx);
		return "app";
	}
    
    @RequestMapping("test3")
    
    

 
    public static void main( String[] args )
    {
    	SpringApplication.run(App.class,args);
    }
}
